﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Threading;
using System.Globalization;
using System.Resources;

using EHTWebsite.Code;

namespace EHTWebsiteProject.Controls
{
    public partial class SupportPhone : System.Web.UI.UserControl
    {
        public Boolean IsVN = true;
        String languageCode = "vi-VN";
        private ResourceManager rm = new ResourceManager("Resources.SiteMap", System.Reflection.Assembly.Load("App_GlobalResources"));

        protected void Page_Load(object sender, EventArgs e)
        {
            try
            {
                languageCode = Session[HangSo.LANGUAGE_CODE].ToString();

                if (languageCode == "en-us")
                {
                    IsVN = false;
                }

            }
            catch (Exception ex)
            {
            }

            if (!Page.IsPostBack)
            {
                ThongTinCongTy theThongTinCongTy = ThongTinCongTyProvider.GetThongTinCongTy();

                if (theThongTinCongTy != null)
                {

                    if (IsVN == true)
                    {
                        this.ltrSupport.Text = theThongTinCongTy.MoTaVN;
                    }
                    else
                    {
                        this.ltrSupport.Text = theThongTinCongTy.MoTaOther;
                    }
                }

                Thread.CurrentThread.CurrentCulture = new CultureInfo(languageCode);
                LoadLanguage(Thread.CurrentThread.CurrentCulture);

                //rpSupports.DataSource = HoTroProvider.GetHoTrosForBackEnd(pageIndex, pageSize, out totalRecord);
                //rpSupports.DataBind();
            }
        }

        public void LoadLanguage(CultureInfo ci)
        {
            // this.ltrSupport_Title.Text = rm.GetString("ltrSupport_Title", ci);
        }
    }
}